cmake_minimum_required(VERSION 3.0.0)
project(teng VERSION 2.1.1)

# teng.cc tengstructs.cc tengutil.cc tengcache.cc \
# tengsourcelist.cc tengdictionary.cc tenginstruction.cc \
# tengparservalue.cc tengparsercontext.cc tengprogram.cc \
# tengfunction.cc tengprocessor.cc tengwriter.cc \
# tengformatter.cc tengcontenttype.cc \
# tengtemplate.cc tenglex1.cc tengsyntax.yy \
# tenglex2.ll tengcode.cc \
# tengmd5.cc tengconfiguration.cc
# include_directories(${CMAKE_CURRENT_LIST_DIR}/src)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_ISOC99_SOURCE -Wall")

set(TENG_INC ${CMAKE_CURRENT_LIST_DIR}/src)

set(TENG_SRC 
  ${CMAKE_CURRENT_LIST_DIR}/src/teng.cc
  ${CMAKE_CURRENT_LIST_DIR}/src/tengstructs.cc
  ${CMAKE_CURRENT_LIST_DIR}/src/tengutil.cc
  ${CMAKE_CURRENT_LIST_DIR}/src/tengcache.cc
  ${CMAKE_CURRENT_LIST_DIR}/src/tengsourcelist.cc
  ${CMAKE_CURRENT_LIST_DIR}/src/tengdictionary.cc
  ${CMAKE_CURRENT_LIST_DIR}/src/tenginstruction.cc
  ${CMAKE_CURRENT_LIST_DIR}/src/tengparservalue.cc
  ${CMAKE_CURRENT_LIST_DIR}/src/tengparsercontext.cc
  ${CMAKE_CURRENT_LIST_DIR}/src/tengprogram.cc
  ${CMAKE_CURRENT_LIST_DIR}/src/tengfunction.cc
  ${CMAKE_CURRENT_LIST_DIR}/src/tengprocessor.cc
  ${CMAKE_CURRENT_LIST_DIR}/src/tengwriter.cc
  ${CMAKE_CURRENT_LIST_DIR}/src/tengformatter.cc
  ${CMAKE_CURRENT_LIST_DIR}/src/tengcontenttype.cc
  ${CMAKE_CURRENT_LIST_DIR}/src/tengtemplate.cc
  ${CMAKE_CURRENT_LIST_DIR}/src/tenglex1.cc
  ${CMAKE_CURRENT_LIST_DIR}/src/tengsyntax.yy
  ${CMAKE_CURRENT_LIST_DIR}/src/tenglex2.ll
  ${CMAKE_CURRENT_LIST_DIR}/src/tengcode.cc
  ${CMAKE_CURRENT_LIST_DIR}/src/tengmd5.cc
  ${CMAKE_CURRENT_LIST_DIR}/src/tengconfiguration.cc
  ${CMAKE_CURRENT_LIST_DIR}/src/round.c
  ${CMAKE_CURRENT_LIST_DIR}/src/tenglex2.cc
  ${CMAKE_CURRENT_LIST_DIR}/src/tengsyntax.cc
  ${CMAKE_CURRENT_LIST_DIR}/src/trunc.c
)

add_library(teng ${TENG_SRC})
target_include_directories(teng PUBLIC ${TENG_INC})
